package com.mew.chess.core.game.shbz.game.message.request;

import com.zebra.common.ZebraBaseMessage;
import io.netty.buffer.ByteBuf;
import lombok.Data;
import lombok.ToString;


@Data
@ToString
public class FireRequestMessage extends ZebraBaseMessage<FireRequestMessage> {

    private int seatNo;  //推送 其他玩家需要
    private int  bulletId; //子弹ID；
    private int bulletType; //子弹类型
    private int betId; //押注ID
    private int isDouble;
    private float x; //X坐标
    private float y; //y 坐标

    @Override
    public void write(ByteBuf b) {

        writeInt(b, this.seatNo);
        writeInt(b, this.bulletId);
        writeInt(b, this.bulletType);
        writeInt(b, this.betId);
        writeInt(b, this.isDouble);
        writeFloat(b, this.x);
        writeFloat(b, this.y);
    }

    @Override
    public FireRequestMessage read(ByteBuf b) {
        FireRequestMessage fireMessage = new FireRequestMessage();
        fireMessage.seatNo = readInt(b);
        fireMessage.bulletId = readInt(b);
        fireMessage.bulletType = readInt(b);
        fireMessage.betId = readInt(b);
        fireMessage.isDouble = readInt(b);
        fireMessage.x = readFloat(b);
        fireMessage.y = readFloat(b);
        return fireMessage;
    }

}
